from django.conf.urls.defaults import patterns
from comunidadcyt.Eventos.models import Eventos
from django.views.generic.create_update import delete_object

evento_info_delete = {
    'model' : Eventos,
    'template_name' : 'Eventos/confirm_delete.html',
    'post_delete_redirect' : '/comunidadcyt/eventos'
}

urlpatterns = patterns('comunidadcyt.Eventos.views',
    (r'^$',                                                                    'index'),
    (r'^create/$',                                                 'create_event_view'),
    (r'^edit/(?P<event_id>\d+)/$',                                   'edit_event_view'),
    (r'^view/(?P<event_id>\d+)/$',                                   'view_event_view'),
    (r'^edit/(?P<is_extern>\w+)/(?P<event_id>\d+)/$',                'edit_event_view'),
    (r'^borrar/(?P<object_id>\d+)/$',                delete_object, evento_info_delete),
    (r'^list/(?P<operation_type>\w+)/$',                             'list_all_events'),
    (r'^listardeptos/(?P<object_id>\d+)/$',                             'listardeptos'),
    (r'^listargrupos/(?P<object_id>\d+)/$',                             'listargrupos'),
    (r'^ver/(?P<object_id>\d+)/$',                                               'ver'),
    (r'^ajax/user/event/(?P<key_xhr>\w+)/$',                    'ajax_get_user_events'),
    (r'^ajax/group/event/(?P<key_xhr>\w+)/$',           'ajax_get_users_groups_events'),
    (r'^ajax/public/event/(?P<key_xhr>\w+)/$',                'ajax_get_public_events')
)
